# from kafka import KafkaConsumer
# from kafka import TopicPartition
# consumer = KafkaConsumer('i211-t_group', bootstrap_servers=['10.164.24.226:9092'])
# consumer = KafkaConsumer(bootstrap_servers='10.164.24.226:9092')
# consumer.subscribe(['i211-t_group'])
# config = {'metadata.broker.list': ','.join('10.164.24.226:9092'),
#             'group.id': '23sdf',
#             'default.topic.config': {'auto.offset.reset': 'latest'},
#             'enable.auto.commit': False,
#             'api.version.request': True,
#             'isolation.level': 'read_uncommitted'
#         }
# consumer = KafkaConsumer(config)
# consumer.subscribe(['i211-t_group'])
# while True:
#     for msg in consumer:
#         recv = "%s:%d:%d: key=%s value=%s" % (msg.topic, msg.partition, msg.offset, msg.key, msg.value)
#         print(recv)
import confluent_kafka as kfk
config = {'bootstrap.servers': '10.164.24.226:9092,',
            'group.id': 'sdfgs',
            'default.topic.config': {'auto.offset.reset': 'earliest'},
            'enable.auto.commit': False,
            'api.version.request': True,
            'isolation.level': 'read_uncommitted'
        }
c = kfk.Consumer(config)
c.subscribe(['i211-t_group'])
while True:
    msg = c.poll(1)
    if msg is None:
        continue
    else:
        if not msg.error() is None:
            print(msg.error())
        else:
            print(str(msg))
        